package com.lzw.breezeNovel.webApp.controller.video;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.model.entity.query.PaginationResultQuery;
import com.lzw.breezeNovel.webApp.service.video.TvSeriesService;
import com.lzw.breezeNovel.webApp.vo.video.TvSeriesVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller.video
 * @date 2025/3/18
 * @description 电视剧
 */
@RestController
@RequestMapping("/app/TV")
@SuppressWarnings("all")
public class TvSeriesController {

    /**
     * 注入service
     */
    @Autowired
    private TvSeriesService tvSeriesService;

    /**
     * 分页获取电视剧的数据
     */
    @RequestMapping("/getTvSeries")
    public Result<PaginationResultQuery<TvSeriesVo>> getTvSeries(@RequestParam Integer pageNo, @RequestParam Integer size) {
        PaginationResultQuery<TvSeriesVo> tvSeriesVos = tvSeriesService.getTvSeries(pageNo, size);
        return Result.ok(tvSeriesVos);
    }

    /**
     * 获取相关电视剧
     */
    @RequestMapping("/getRelatedTvSeries")
    public Result<List<TvSeriesVo>> getRelatedTvSeries(@RequestParam String type,@RequestParam Integer videoId) {
        List<TvSeriesVo> tvSeriesVos = tvSeriesService.getRelatedTvSeries(type, videoId);
        return Result.ok(tvSeriesVos);
    }

}
